package com;

import com.config.MyConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.ConcurrentModificationException;

@SpringBootApplication
public class MainApplication {
    public static void main(String[] args) {
//        SpringApplication.run(MainApplication.class,args);
//        //1.返回我们的IOC容器
//        ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);
//
//        //2.查看容器里的组件
//        String[] names = run.getBeanDefinitionNames();
//        for (String name : names){
//            System.out.println(name);
//        }
        ApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
        context.getBean("myBean");
    }
}
